<%--
  Created by IntelliJ IDEA.
  User: gaosubo
  Date: 2020/9/12
  Time: 18:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>评选结果</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/lib/layui/layui/css/layui.css"/>
    <script type="text/javascript" src="/js/news/jquery-1.9.1.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/jquery/jquery.cookie.js"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.ui.widget.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.iframe-transport.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.fileupload.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="/js/common/fileupload.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.all.js"></script>
</head>
<style>
    .btn {
       float: right;
    }
    .layui-form-item {
        margin-bottom: 5px;
    }
    .layui-input-inline{
        width: 300px !important;
    }
    .layui-icon-ok{
        margin-top: 6px;
    }
</style>
<body>
<div>
    <div class="item">
        <img src="../img/chengguo.png" alt="" style="margin: 0 5px 0 20px;"> <span
            style="font-size: 22px;display: inline-block;vertical-align: middle;">评选结果</span>
    </div>
    <hr class="layui-bg-blue">
    <div style="height: 30px">
        <div class="btn">
            <button type="button" class="layui-btn immp layui-btn-sm " id="export" onclick="exportFun()" style="margin-right: 15px" >
                <i class="layui-icon">&#xe601;</i>
                导出
            </button>
        </div>
    </div>
    <div>
        <table class="layui-hide test" id="test" lay-filter="test"></table>
    </div>
</div>

</body>
</html>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="edit">查看</a>
</script>
<script>
    function checkStatus(status){
        if(status == 1){
            return '待审批';
        }else if(status == 2){
            return '已批准';
        }else if(status == 3){
            return '未批准';
        }
    }

    layui.use(['table', 'layer', 'form','laydate','upload'], function () {
        var table = layui.table
            , layer = layui.layer
            , form = layui.form
            , upload = layui.upload
            , laydate = layui.laydate
        $(document).ready(function(){
            form.render();
        });
        var tableInt = table.render({
            elem: '.test'
            ,url: '/rpmTopicRemark/selectResults'
            ,where:{
                trType:19,trStatus:2,
                ctreateType:3
            }
            ,parseData: function(res){ //res 即为原始返回的数据
                return {
                    "code":0, //解析接口状态
                    "data": res.data, //解析数据列表，
                    "count": res.totleNum, //解析数据长度
                };
            }
            , cols: [[
                {type: 'checkbox'},
                {field: 'planName', title: '任务名称', align: 'center'}
                , {field: 'topicName', title: '成果名称', align: 'center'}
                , {field: 'topicTypeName', title: '成果类型', align: 'center'} //minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
                , {field: 'userName', title: '申报人姓名', align: 'center'}
                , {field: 'deptName', title: '科室', align: 'center'}
                , {field: 'userStatus', title: '申报状态', align: 'center'}
                , {field: 'trOther', title: '等级', align: 'center'}
                , {field: 'type', title: '操作', toolbar: '#barDemo'}
            ]],
            page:true
        });

        //监听行工具事件
        table.on('tool(test)', function(obj){
            var layEvent = obj.event;
            var data = obj.data;
            if(layEvent === 'edit'){
                layer.open({
                    type: 2,
                    title:'查看详情',
                    area: ['70%', '85%'],
                    content: '/Results/declaration?planId='+data.planId+'&type='+1 +'&topicId=' + data.topicId+'&edit=0',
                    yes:function (index, layero) {
                        var myIframe = window[layero.find('iframe')[0]['name']];
                        var fnc = myIframe.submitEdit();
                    },
                    btn2:function (index, layero) {
                        var saveIframe = window[layero.find('iframe')[0]['name']];
                        var fnc = saveIframe.submitsave();
                    }
                })
            }
        });
    })

    function exportFun(){
        window.open('/rpmTopicRemark/selectResults?trType=19&trStatus=2&ctreateType=3&exportType=1');
    }
</script>
